{include file="common/header"}
<div class="content-wrapper">
    {include file="member/nav"}
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="nav-tabs-custom">
                    {include file="member/tabs"}
                    <div class="tab-content">
                        <div class="page-content">
                            <div class="panel panel-info">
                                <div class="panel-heading">
                                    筛选
                                    <span class="pull-right">共有会员&nbsp;<font style="color: red;font-weight: bold;">{$total}</font>&nbsp;人，会员余额累计总额&nbsp;<font style="color: red;font-weight: bold;">{$credit2Total}</font>元</span>
                                </div>
                                <div class="panel-body">
                                    <form class="form-horizontal" method="get" role="form">
                                        <div class="form-group">
                                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">关键词</label>
                                            <div class="col-sm-6 col-md-8 col-lg-8 col-xs-12">
                                                <input type="text" class="form-control" name="keyword" value="{$_GET['keyword']?$_GET['keyword']:''}" placeholder="请输入会员编号、用户名、手机号关键词">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">状态</label>
                                            <div class="col-sm-6 col-md-8 col-lg-8 col-xs-12">
                                                <label class="checkbox-inline">
                                                    <input type="checkbox" name="is_check[]" {if !empty($_GET['is_check']) && in_array(1,$_GET['is_check'])}checked{/if} value="1">
                                                    正常
                                                </label>
                                                <label class="checkbox-inline">
                                                    <input type="checkbox" name="is_check[]" {if !empty($_GET['is_check']) && in_array(0,$_GET['is_check'])}checked{/if} value="0">
                                                    已禁用
                                                </label>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <div class="col-sm-6 col-md-8 col-lg-8 col-xs-12 col-md-offset-2 col-lg-offset-2 col-sm-offset-4">
                                                <button class="btn btn-primary">搜索</button>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>


                            <form method="post" class="form-horizontal" id="display_form">
                                <div class="panel panel-default ">
                                    <div class="table-responsive panel-body">
                                        <table class="table table-hover">
                                            <thead class="navbar-inner">
                                            <tr>
                                                <th style="width: 45px">删?</th>
                                                <th>会员编号</th>
                                                <th>用户名</th>
                                                <th>积分/余额</th>
                                                <th>邮箱</th>
                                                <th>支付宝</th>
                                                <th>手机</th>
                                                <th>推荐人ID</th>
                                                <th>邀请人数</th>
                                                <th>返利收益</th>
                                                <th>合作渠道</th>
                                                <th>注册时间</th>
                                                <th>操作</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            {if !empty($list)}
                                                {volist name="list" id="item"}
                                                <tr>
                                                    <td>
                                                        <input type="checkbox" name="ids[]" value="{$item['uid']}">
                                                    </td>
                                                    <td>{$item['uid']}</td>
                                                    <td>{$item['username']}</td>
                                                    <td>
                                                        <label class="label label-success">{$item['credit1']}</label>
                                                        &nbsp;/&nbsp;
                                                        <label class="label label-primary">{$item['credit2']}</label>
                                                    </td>
                                                    <td>{$item['email']}</td>
                                                    <td>
                                                        账号:{$item['alipay_account']} /
                                                        姓名:{$item['alipay_realname']}
                                                    </td>
                                                    <td>{$item['mobile']}</td>
                                                    <td>{$item['parent_uid']}</td>
                                                    <td>{$item['invite_total']}</td>
                                                    <td>
                                                        <label class="label label-success">{$item['invite_rebate']}</label>
                                                    </td>
                                                    <td>{$item['channel_name']}</td>
                                                    <td>
                                                        {$item['create_time']}
                                                    </td>
                                                    <td>
                                                        <a href="{:U('post', 'id=' . $item['uid'])}" class="btn btn-sm btn-success">编辑</a>
                                                    </td>
                                                </tr>
                                                {/volist}
                                                <tr>
                                                    <td>
                                                        <input type="checkbox" onclick="var ck = this.checked;$('table').find(':checkbox').each(function(){this.checked = ck});">
                                                    </td>
                                                    <td colspan="6">
                                                        <button class="btn btn-sm btn-danger" name="submit" type="button">删除</button>
                                                    </td>
                                                </tr>
                                            {/if}
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </form>
                            {$pager}
                            <script type="text/javascript">
                                $(function () {
                                    $('button[name="submit"]').bind('click',function() {
                                        if (confirm('删除后不可恢复，您确定删除吗？')) {
                                            $.post(
                                                window.location.href,
                                                $('#display_form').serialize(),
                                                function (ret) {
                                                    message(ret.message, ret.redirect, ret.type);
                                                }, 'json'
                                            );
                                        }
                                    });
                                });
                            </script>
                        </div>
                    </div>
                    <!-- /.tab-content -->
                </div>
                <!-- /.nav-tabs-custom -->
            </div>
            <!-- /.col -->
        </div>
    </section>
</div>
{include file="common/footer"}
